<template>
  <div class="content">
    <div class="succeedBox">
      <i-icon type="success_fill" size="140" color="#0ebf89" />
      <p>{{form.label}}</p>
      <button class="btn" @click="onClickSucceed">{{form.btnText}}</button>
    </div>
  </div>
</template>

<script>
import {} from '@/api'
import { getCurrentPageParams } from '@/utils'

export default {
  components: {},
  props: {},
  data () {
    return {
      type: '',
      form: {
        label: '',
        btnText: ''
      }
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  onShow () {
    this.init()
  },
  methods: {
    onClickSucceed () {
      const vm = this
      if (getCurrentPageParams('type') === 'stock') {
        vm.$router.replace(
          // '/pages/data-analyze/stock/supply/order/list/main?type=stock'
          `/pages/data-analyze/stock/my/order/main`
        )
      } else {
        vm.$router.replace(
          '/pages/data-analyze/stock/supply/order/list/main?type=check'
        )
      }
    },
    init () {
      const vm = this
      vm.form.label = getCurrentPageParams('label') || '成功'
      vm.form.btnText = getCurrentPageParams('btnText') || '确认'
      let title = getCurrentPageParams('type') === 'stock' ? '进货完成' : '完成'
      wx.setNavigationBarTitle({
        title
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import 'static/styles/color.scss';
.content {
  height: auto;
  height: 80%;
  display: flex;
  align-items: center;
  .succeedBox {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    > .btn {
      width: 95%;
      margin: 60px auto 0;
      height: 45px;
      font-size: 14px;
      color: #fff;
      line-height: 45px;
      border-radius: 25px;
      background: linear-gradient(to right, $new-red-tint, $new-red-dark);
    }
  }
}
</style>
